<script>
  import '@/assets/styles/index.scss'
  import 'nprogress/nprogress.css'
  import { mapState } from 'vuex'

  export default {
    name: 'App',
    computed: {
      ...mapState('viewState', ['themeColor'])
    },
    watch: {
      themeColor: {
        immediate: true,
        handler() {
          document.getElementsByTagName('html')[0].style.cssText += `;--color-primary: ${this.themeColor};`
        }
      }
    },
    render() {
      return (
        <div id="app">
          <RouterView />
        </div>
      )
    }
  }
</script>
